//
//  WBStatusTool.swift
//  WeiBoAPP
//
//  Created by 张学飞 on 2019/7/31.
//  Copyright © 2019 zxf. All rights reserved.
//

import UIKit

class WBStatusTool: UIView {

    @IBOutlet weak var button1 :UIButton!
    @IBOutlet weak var button2 :UIButton!
    @IBOutlet weak var button3 :UIButton!
  
    
    
    var viewModel:WBStatueViewModel? {
        
        didSet {
            //可选值，强行解包或设置默认值
            button1.setTitle("转发 \(viewModel?.status.repost_count ?? 0)", for: [])
            button2.setTitle("评论 \(viewModel?.status.comment_count ?? 0)", for: [])
            button3.setTitle("点赞 \(viewModel?.status.attribue_count ?? 0)", for: [])
        }
        
    }
    
    
    @IBAction func button1Action1(_ sender: Any) {
        
        print("转发")
    }
 
    @IBAction func button1Action2(_ sender: Any) {
        print("评论")
    }
    @IBAction func button1Action3(_ sender: Any) {
        print("点赞")
    }
    
    /*
    // Only override draw() if you perform custom drawing.
    // An empty implementation adversely affects performance during animation.
    override func draw(_ rect: CGRect) {
        // Drawing code
    }
    */

}
